#ifndef VIEW_H
#define VIEW_H

#include "Troll3D_global.h"


#include <Entity.h>


/*! @brief The view class will be used to determine the position and orientation of the
 *  camera in the world
 *  For now, Only One Camera is Available at one time
 */
class TROLL3DSHARED_EXPORT View
{
    public :

    /********************************/
    /*          Members             */
    /********************************/

        /********************************/
        /*          Properties          */
        /********************************/

            Matrix4*    m_ViewMatrix;       /*!< The view matrix send to the Shaders         */

            vec4        m_Forward;

            Matrix4     m_Projection;       /*!< Projection linked to the current camera    */
            vec4*       m_Position;         /*!< Current position of the view               */
            vec4*       m_RotationEuler;    /*!< Rotation of the view                       */

            int         buttonPressed;
            int         xAnchor;
            int         yAnchor;

            float       teta;
            float       phi;

        /********************************/
        /*          Methods             */
        /********************************/

            void ComputeForward();

            void LookAt(float x, float y, float z);

            void SendMatrix(GLuint programID);
            virtual void RotateView(int x, int y);

        /********************************/
        /*      Virtual Methods         */
        /********************************/

            virtual void Display();
            virtual void Update();
            virtual void UpdateMatrix();

    /********************************/
    /*          Constructor         */
    /********************************/

            View();

    /********************************/
    /*          Static              */
    /********************************/

        /********************************/
        /*          Properties          */
        /********************************/

            static View * MainView;

};

#endif
